import time
from selenium import webdriver
from selenium.webdriver.common.by import By


class Testcase:
    def __init__(self):
        self.driver = webdriver.Chrome()
        self.driver.get("https://www.so.com")

    def search_baidu(self):
        self.driver.find_element(By.ID,'input').send_keys('python自动化测试')
        self.driver.find_element(By.ID,'search-button').click()

        time.sleep(3)
        print(self.driver.title)
        if 'python' in self.driver.title:
            print('找到了')
        else:
            print('没找到')

    def quit(self,seconds=3):
        time.sleep(seconds)
        self.driver.quit()




case = Testcase()
case.search_baidu()
case.quit()

